# 头文件
INLCUDES := ../../include

# 选出所有后缀为.c或.S的文件,将其名称后缀替换为.o,作为输出目标
target := console.o \
          plic.o \
          rtc.o \
          timer.o \
          uart.o \
          uart8250.o \
          virtio_disk.o \
          disk.o

# 定义了一些通用操作和参数
include ../../Common.mk

ifeq ($(PLATFORM), visionfive)
target += ram_disk.o
endif

%.o: %.S
	$(CC) $(CFLAGS) -I $(INLCUDES) -c $<

%.o: %.c
	$(CC) $(CFLAGS) -I $(INLCUDES) -c $<

.PHONY: build clean

build: $(target)

clean:
	rm -f *.o *.d